import request from '@/utils/request'

// 查询主管单位列表
export function listOrg(query) {
  return request({
    url: '/org/org/list',
    method: 'get',
    params: query
  })
}

export function getAllOrg() {
  return request({
    url: '/org/org/getAll',
    method: 'get'
  })
}
export function getAllOrgList() {
  return request({
    url: '/org/org/getAllOrgList',
    method: 'get'
  })
}

export function areaTree() {
  return request({
    url: '/area/area/areaTree',
    method: 'get'
  })
}

export function tagSelect(query) {
  return request({
    url: '/tag/tag/tagSelect',
    method: 'get',
    params: query
  })
}

// 查询主管单位详细
export function getOrg(orgId) {
  return request({
    url: '/org/org/' + orgId,
    method: 'get'
  })
}

// 新增主管单位
export function addOrg(data) {
  return request({
    url: '/org/org',
    method: 'post',
    data: data
  })
}

// 修改主管单位
export function updateOrg(data) {
  return request({
    url: '/org/org',
    method: 'put',
    data: data
  })
}

// 删除主管单位
export function delOrg(orgId) {
  return request({
    url: '/org/org/' + orgId,
    method: 'delete'
  })
}
